package com.igroupes.ovineherd.query;

import com.igroupes.ovineherd.entity.DataModelAttributeEntity;
import lombok.Data;

@Data
public class FieldQuery {
    private String fieldName; //名称
    private String type; //类型
    private Integer length; //长度
    private Integer precision = 0; //精度
    private Integer isNull; //可为空 1：能 2：不能
    private String defaultValue; //默认值
    private String comment; //字段备注
    private DataModelAttributeEntity dataModelAttributeEntity;

    public FieldQuery() {
    }

    public FieldQuery(String fieldName, Integer isNull, String comment) {
        this.fieldName = fieldName;
        this.isNull = isNull;
        this.comment = comment;
    }

    public FieldQuery(String fieldName, Integer isNull) {
        this.fieldName = fieldName;
        this.isNull = isNull;
    }

    public FieldQuery(String fieldName, String type) {
        this.fieldName = fieldName;
        this.type = type;
    }

    public FieldQuery(String fieldName, String type, Integer isNull) {
        this.fieldName = fieldName;
        this.type = type;
        this.isNull = isNull;
    }

    public FieldQuery(String fieldName, String type, Integer length, Integer isNull) {
        this.fieldName = fieldName;
        this.type = type;
        this.length = length;
        this.isNull = isNull;
    }

    public FieldQuery(String fieldName, String type, Integer isNull, String comment) {
        this.fieldName = fieldName;
        this.type = type;
        this.isNull = isNull;
        this.comment = comment;
    }

    public FieldQuery(String fieldName, String type, Integer isNull, String defaultValue, String comment) {
        this.fieldName = fieldName;
        this.type = type;
        this.isNull = isNull;
        this.defaultValue = defaultValue;
        this.comment = comment;
    }
}
